/**
 * 根据path路径获取matched
 * @param routes 菜单routes
 * @param path 路径
 * @returns {*} matched
 */
export const HandleMatched = (routes, path) => {
  return routes
    .filter((route) => route.childrenPathList.indexOf(path) + 1)
    .flatMap((route) =>
      route.children ? [route, ...handleMatched(route.children, path)] : [route]
    );
};
